package org.hwadee.entity;

import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.List;

@Component
public class Post {
    /* 帖子ID */
    private Integer postId;
    /* 帖子作者id */
    private Integer postUserId;
    /* 帖子标题 */
    private String title;
    /* 帖子浏览量 */
    private Integer postViewCount;
    /* 帖子评论量 */
    private Integer commentCount;
    /* 帖子点赞量 */
    private Integer likeCount;
    /* 帖子创建时间 */
    private Date createTime;
    /* 帖子更新时间 */
    private Date updateTime;
    /**
     * 帖子状态
     * 0表示帖子已删除，1表示帖子未删除
     */
    private Integer postStatus;
    /* 帖子内容 */
    private String postContent;
    /* 帖子概述 */
    private String postSummary;
    /* 帖子类别 */
    private Integer categoryId;
    /* 文章作者 */
    private User user;

    private Category cat;

    public Post() {
    }

    public Post(Integer postId, Integer postUserId, String title, Integer postViewCount, Integer commentCount, Integer likeCount, Date createTime, Date updateTime, Integer postStatus, String postContent, String postSummary, Integer category) {
        this.postId = postId;
        this.postUserId = postUserId;
        this.title = title;
        this.postViewCount = postViewCount;
        this.commentCount = commentCount;
        this.likeCount = likeCount;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.postStatus = postStatus;
        this.postContent = postContent;
        this.postSummary = postSummary;
        this.categoryId = category;
    }

    public Integer getPostId() {
        return postId;
    }

    public Category getCat() {
        return cat;
    }

    public void setCat(Category cat) {
        this.cat = cat;
    }

    public void setPostId(Integer postId) {
        this.postId = postId;
    }

    public Integer getPostUserId() {
        return postUserId;
    }

    public void setPostUserId(Integer postUserId) {
        this.postUserId = postUserId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Integer getPostViewCount() {
        return postViewCount;
    }

    public void setPostViewCount(Integer postViewCount) {
        this.postViewCount = postViewCount;
    }

    public Integer getCommentCount() {
        return commentCount;
    }

    public void setCommentCount(Integer commentCount) {
        this.commentCount = commentCount;
    }

    public Integer getLikeCount() {
        return likeCount;
    }

    public void setLikeCount(Integer likeCount) {
        this.likeCount = likeCount;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Integer getPostStatus() {
        return postStatus;
    }

    public void setPostStatus(Integer postStatus) {
        this.postStatus = postStatus;
    }

    public String getPostContent() {
        return postContent;
    }

    public void setPostContent(String postContent) {
        this.postContent = postContent;
    }

    public String getPostSummary() {
        return postSummary;
    }

    public void setPostSummary(String postSummary) {
        this.postSummary = postSummary;
    }

    public Integer getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(Integer categoryId) {
        this.categoryId = categoryId;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    @Override
    public String toString() {
        return "Post{" +
                "postId=" + postId +
                ", postUserId=" + postUserId +
                ", title='" + title + '\'' +
                ", postViewCount=" + postViewCount +
                ", commentCount=" + commentCount +
                ", likeCount=" + likeCount +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                ", postStatus=" + postStatus +
                ", postContent='" + postContent + '\'' +
                ", postSummary='" + postSummary + '\'' +
                ", category=" + categoryId +
                ", user=" + user +
                '}';
    }
}
